package com.design3.graduatethesissys.controller;


import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.design3.graduatethesissys.common.utils.FileUtil;
import com.design3.graduatethesissys.common.utils.GetUserName;
import com.design3.graduatethesissys.service.impl.StudentServiceImpl;

@Controller
public class Common {
	
	@Autowired
	StudentServiceImpl studentMapper;
	
	@RequestMapping(value = "/Student/getMyID")
	@ResponseBody
	public String demo(){
	    return GetUserName.getUserName();
	}
	
	/** 学生端的聊天消息接口
	 * 
	 * @return
	 */
	@RequestMapping(value = "/Student/getTeacher")
	@ResponseBody
	public List<Map<String, Object>> getTeacher() {
		return studentMapper.getTeacher();
	}

	
	@RequestMapping(value = "/Teacher/getMyID")
	@ResponseBody
	public String demo1(){
	    return GetUserName.getUserName();
	}
	
	@RequestMapping(value = "/Student/isUpload")
	@ResponseBody
	public String isUpload(@RequestParam("sbj_status") String sbj_status) {
		return FileUtil.isUpload(GetUserName.getUserName(), sbj_status);
	}
	
}
